﻿using Godot;
using Godot.Collections;
using System;


public class CopperFluidPipeEntity : BlockEntity
{
    public int tick = 5;
    public FluidData steam = new FluidData("steam", 0, 800);
    public override Dictionary getDict()
    {
        Dictionary dict = new Dictionary();
        dict.Add("steam", steam.GetDictionary());
        dict.Add("tick", tick);
        return dict;
    }
    public override BlockEntity JsonTo(Dictionary dict)
    {
        steam.Parse((Dictionary)dict["steam"]);
        tick = dict["tick"].ToInt();
        return this;
    }
    public override FluidData GetFluid(int index)
    {
        if (index == 0) return steam;
        else return null;
    }
    public override FluidData GetFluid(String name)
    {
        if (name == "steam") return steam;
        else return null;
    }
    public override String toJson()
    {
        return JSON.Print(getDict());
    }
    public override Store GetStore()
    {
        return null;
    }
}

